<?php 
  require_once('nav.php');
 ?>
    <div class="col-sm-9 col-md-10">
      <?php 
       $sql = 'select * from videotype';
       $result = fetch_array($sql); 
       ?>
    <center><h3>视频类别列表</h3></center>
   <table class="table table-hover"> 
   <tr>
     <th>编号</th>
     <th>视频类别名称</th>   
     <th>操作</th>
   </tr>
   <?php

     foreach ($result as $row) {
     echo '<tr>';
     echo '<td>'.$row['tid'].'</td>';
     echo '<td><a href="videoSearch.php?id='.$row['tid'].'">'.$row['typename'].'</a></td>';
     echo '<td><a href="vtEditForm.php?id='.$row['tid'].' ">修改</a> | 
     <a href="vtDelete.php?id='.$row['tid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
     echo '</tr>';  
    }
    echo '</table>';  
    $totalrows = count($result);//$resule是数组，求行数
    echo "<table align='center'><tr><td>共有{$totalrows}条记录</td></tr></table>";  
   ?>   

    </div>
    <?php 
      require_once('footer.php');
     ?>
 
   